package com.up4years.dataapi.service.support;

import com.qiniu.util.Auth;
import com.up4years.utils.CommonUtil;

public class CDNService {
	/**
	 * 获取七牛CDN的上传凭证
	 * @param bucket 七牛存储空间名
	 * @return
	 */
	public static String getUpToken(String bucket) {
		Auth auth = Auth.create(CommonUtil.getQiniuAccessKey(),
				CommonUtil.getQiniuSecretKey());
		return auth.uploadToken(bucket);
	}
	/**
	 * 获取七牛CDN的上传凭证 采用默认存储空间
	 * @return
	 */
	public static String getUpToken() {
		Auth auth = Auth.create(CommonUtil.getQiniuAccessKey(),
				CommonUtil.getQiniuSecretKey());
		return auth.uploadToken(CommonUtil.getQINIU_BUCKET());
	}
}
